//
//  UIDeviceExt.swift
//  SeeFM_Swift
//
//  Created by CBCT_MBP on 2021/6/21.
//

import Foundation
import UIKit

extension UIDevice {
    
    public func systemVersionNunber() -> Double {
        return Double(UIDevice.current.systemVersion)!
    }
    
    public func isIPad() -> Bool {
        return UI_USER_INTERFACE_IDIOM() == .pad
    }
    
    public func deviceName() -> String {
        
        return "iPhone"
        
    }
    
    public func uuidStr() -> String {
        return UIDevice.current.identifierForVendor!.uuidString
    }
    
    func imeiStr() -> String {
        let retriveuuid = SAMKeychain.password(forService: "comSeeFMwww", account: "seeFMAccount")
        if let imei = retriveuuid {
            return imei
        }else {
            let uuidStr = self.uuidStr()
            SAMKeychain.setPassword(uuidStr, forService: "comSeeFMwww", account: "seeFMAccount")
            return uuidStr
        }
    }
    
}

